import json


input_file = r"/data/PaddlePaddle/translation2019zh_valid(39k).json"
output_file = r"D:\FengGong_Project\Machine_Trans\data\PaddlePaddle\translation2019zh_valid(39k)_fixed_file.json"

with open(input_file, "r", encoding="utf-8") as f:
    lines = f.readlines()

# 将所有 JSON 对象存入列表
data_list = [json.loads(line.strip()) for line in lines]

# 重新保存为正确的 JSON 格式
with open(output_file, "w", encoding="utf-8") as f:
    json.dump(data_list, f, ensure_ascii=False, indent=4)

print(f"修复完成，文件已保存到 {output_file}")
